home *** CD-ROM | disk | FTP | other *** search
/ Revista do CD-ROM 101 / CD-ROM 101.iso / compl / maya5ple / Install_MayaPLE5_English.exe / Maya / Data1.cab / fitBsplineToolScript.mel < prev    next >
Encoding:
Text File  |  2003-07-17  |  3.5 KB  |  124 lines

  1. // Copyright (C) 1997-2002 Alias|Wavefront,
  2. // a division of Silicon Graphics Limited.
  3. //
  4. // The information in this file is provided for the exclusive use of the
  5. // licensees of Alias|Wavefront.  Such users have the right to use, modify,
  6. // and incorporate this code into other products for purposes authorized
  7. // by the Alias|Wavefront license agreement, without fee.
  8. //
  9. // ALIAS|WAVEFRONT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
  10. // INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
  11. // EVENT SHALL ALIAS|WAVEFRONT BE LIABLE FOR ANY SPECIAL, INDIRECT OR
  12. // CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
  13. // DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
  14. // TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
  15. // PERFORMANCE OF THIS SOFTWARE.
  16. //
  17. //
  18. // Alias|Wavefront Script File
  19. // MODIFY THIS AT YOUR OWN RISK
  20. //
  21. // Creation Date:  14 January 1999
  22. // Author:         sw
  23. //
  24. //
  25. //  Procedure Name:
  26. //      fitBsplineToolScript
  27. //
  28. //  Description:
  29. //    create wrapper around the fitBspline command
  30. //
  31. //  Input Arguments:
  32. //        0 ==> do the command.
  33. //        1 ==> show the tool/action option box
  34. //        2 ==> return the command
  35. //        3 ==> show tool/action option box
  36. //        4 ==> enter the tool
  37. //
  38. //  Return Value:
  39. //      None.
  40. //
  41.  
  42. global proc fitBsplineToolSetup( int $forceFactorySettings, string $goToTool )
  43. {
  44.     if( $forceFactorySettings || !`optionVar -ex fitBsplineEuc` ) {
  45.         optionVar -iv fitBsplineEuc 0;
  46.     }
  47.     if( $forceFactorySettings || !`optionVar -ex fitBsplineLac` ) {
  48.         optionVar -iv fitBsplineLac 1;
  49.     }
  50.     if( "" != $goToTool ) {
  51.         scriptCtx -e -euc `optionVar -q fitBsplineEuc` $goToTool;
  52.         scriptCtx -e -lac `optionVar -q fitBsplineLac` $goToTool;
  53.     }
  54. }
  55.  
  56. global proc fitBsplineValues ( string $toolName ) 
  57. {
  58.     performFitBspline 3 $toolName;
  59.     scriptCtxCommonValues( $toolName );
  60. }
  61.  
  62. global proc fitBsplineProperties()
  63. {
  64.     scriptCtxCommonProperties;
  65. }
  66.  
  67. proc createFitBsplineContext( string $tool )
  68. {
  69.     if( ! `scriptCtx -exists $tool` ) {
  70.         fitBsplineToolSetup( 0, "" );
  71.         scriptCtx -i1 "fitBSpline.xpm"
  72.             -title "Fit B-spline Tool"
  73.             -bcn "fitBspline"
  74.  
  75.             -exitUponCompletion `optionVar -q fitBsplineEuc`
  76.             -totalSelectionSets 1
  77.             -expandSelectionList true
  78.             -fcs ("fitBsplineToolScript 0")
  79.  
  80.             -setNoSelectionPrompt ("Select NURBS curves, isoparms, " +
  81.                                    "curves on surface, " +
  82.                                    "trim edge(s) or polygon edges.")
  83.             -setSelectionPrompt ("Select additional NURBS curves, " +
  84.                                  "curves on surface, " +
  85.                                  "isoparms, trim edge(s) or polygon edges. " +
  86.                                  "Press ENTER to compute fit to each one.")
  87.  
  88.             -setAutoToggleSelection true
  89.             -setAutoComplete `optionVar -q fitBsplineLac`
  90.             -setAllowExcessCount true
  91.             -showManipulators true
  92.  
  93.             -setSelectionCount 0
  94.             -nurbsCurve true
  95.             -isoparm true
  96.             -curveOnSurface true
  97.             -surfaceEdge true
  98.             -polymeshEdge true
  99.         $tool;
  100.     }
  101. }
  102.  
  103. global proc string fitBsplineToolScript( int $setToTool )
  104. //
  105. //    Description :
  106. //        0 ==> do the command.
  107. //        1 ==> show the action option box
  108. //        2 ==> return the command
  109. //        3 ==> show tool/action option box
  110. //        4 ==> enter the tool/do the command
  111. {
  112.     string $tool = "";
  113.     if( $setToTool > 2 ) {
  114.         if( !`optionVar -q modelWithToolFitBspline` ) {
  115.             $setToTool = 4 - $setToTool;
  116.         }
  117.         else {
  118.             $tool = "fitBsplineContext";
  119.             createFitBsplineContext $tool;
  120.         }
  121.     }
  122.     return scriptToolScript( "performFitBspline", $setToTool, $tool );
  123. }
  124.